//
//  ObjectSprite.m
//  Soccer
//
//  Created by Hyun-Woong Kim on 09. 05. 06.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "ObjectSprite.h"
#import "Stadium.h"
#import "Player.h"
#import "Ball.h"


@implementation ObjectSprite

@synthesize delegate = _delegate;

- (id)initWithDelegate:(id<ObjectSpriteDelegate>)delegate
{
	NSString *fileName = [delegate getFileName];
	if (self = [super initWithFile:fileName])
	{
		self.delegate = delegate;
		[_delegate spriteNeedsInit:self];
//		self.transformAnchor = CGPointMake(0, 0);
	}
	return self;
}

- (void)dealloc
{
	[_delegate release];
	[super dealloc];
}

- (void)setZOrder:(int)z
{
	[parent reorderChild:self z:z];
}

- (void)updatePosition
{
	[_delegate spriteNeedsUpdates:self];
}

@end
